package com.example.shengyin.dao;

import com.example.shengyin.entity.Article;
import com.example.shengyin.entity.ArticleSimple;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;
@Service
public interface ArticleMapper {

    Article selectById(@Param("id") Long id);

    int insert(Article article);

    int update(Article article);

    int deleteById(@Param("id") Integer id);

    //删除多个
    int deleteByIds(@Param("ids") String ids);

    public List<Article> articleList(@Param("pagestart") int pagestart, @Param("limit") int limit, @Param("type") String type, @Param("typecode") String typecode,
                                     @Param("createby") String createby, @Param("start") Timestamp start, @Param("end") Timestamp end);

    public int countTotall(@Param("type") String type, @Param("typecode") String typecode,
                           @Param("createby") String createby, @Param("start") Timestamp start, @Param("end") Timestamp end);


    List<ArticleSimple> selecthot(@Param("number") int number);

    List<ArticleSimple> selectrecomend(@Param("number") int number);

    List<ArticleSimple> selectnewwest(@Param("number") int number);
    List<ArticleSimple> articleList3(@Param("pagestart") int pagestart, @Param("limit") int limit, @Param("type") String type, @Param("typecode") String typecode,
                                     @Param("createby") String createby, @Param("start") Timestamp start, @Param("end") Timestamp end);
    List<ArticleSimple> articleList2(@Param("pagestart") int pagestart, @Param("limit") int limit, @Param("type") String type, @Param("typecode") String typecode,
                                     @Param("createby") String createby, @Param("start") Timestamp start, @Param("end") Timestamp end);


    List<ArticleSimple> Eventshot(@Param("number") int number);

    List<ArticleSimple> Eventsrecomend(@Param("number") int number);

    List<ArticleSimple> Eventsnewwest(@Param("number") int number);


    List<Article> selectByNmae(@Param("name")String name,@Param("type") String type,@Param("typecode") String typecode);
}